<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="./css/style.css">
    <link rel="stylesheet" href="./css/bootstrap.min.css">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
    <title></title>
</head>

<body class="gray-bg">


    <!--Header-->
    <div class="header-div" id="top">
        <div class="mid-header clearfix">
            <a href="home.html" class="logo-font">Delicious</a>
            <span class="header-right-box">
            <!--<a href="${pageContext.request.contextPath }/linkRegister" class="header-link-box"><button type="button">Login</button></a>-->
            <!--<span> | </span>-->
            <!--<a href="${pageContext.request.contextPath }/linkLogin" class="header-link-box"><button type="button">Register</button></a>-->

            <span class="wlc-font">Welcome, Avril</span>
            <a href="javascript:void(0)" class="header-link-box">
                <button type="button">查看订单</button>
            </a>
            <span> | </span>
            <a href="javascript:void(0);" class="header-link-box" data-toggle="modal" data-target="#SignInModal">
                <button type="button">注销</button>
            </a>
            </span>
        </div>
    </div>


    <div class="mid-nav center outer-carousel">
        <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
            <!-- Indicators -->
            <ol class="carousel-indicators">
                <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
                <li data-target="#carousel-example-generic" data-slide-to="1"></li>
                <li data-target="#carousel-example-generic" data-slide-to="2"></li>
            </ol>

            <!-- Wrapper for slides -->
            <div class="carousel-inner" role="listbox">
                <div class="item active">
                    <a href="javascript:void(0)"> <img src="./img/1.jpg">
                        <div class="carousel-caption">M记</div>
                    </a>
                </div>
                <div class="item">
                    <a href="javascript:void(0)"> <img src="./img/2.jpg">
                        <div class="carousel-caption">必胜客</div>
                    </a>
                </div>
                <div class="item">
                    <a href="javascript:void(0)"> <img src="./img/3.jpg">
                        <div class="carousel-caption">贡茶</div>
                    </a>
                </div>
            </div>

            <!-- Controls -->
            <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </div>


    <div class="mid-nav shadow-div">
        <div class="row list-row">
            <div class="col-sm-4 col-md-3">
                <div class="thumbnail">
                    <i class="inside-icon glyphicon glyphicon-search"></i>
                    <a href="#">
                        <img src="./img/07.jpg" class="home-img">
                        <div class="caption">
                            <h3>Merchant 001</h3>
                            <div class="row no-margin">
                                <div class="col-md-8">
                                    <span class="glyphicon glyphicon-phone-alt tel-icon"></span> <b>13912345678</b>
                                </div>
                                <div class="col-md-4">
                                    <span>4.5分</span>
                                </div>
                            </div>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>

    <a href="#top">
        <div class="top-box">
            <span class="glyphicon glyphicon-chevron-up back-icon"></span>
        </div>
    </a>




    <!-- 登录模态框 -->
    <div class="modal fade" id="SignInModal" tabindex="-1" role="dialog" aria-labelledby="title">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="title">Sign in</h4>
                </div>
                <div class="modal-body">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-md-12">
                                <div class="panel panel-default">
                                    <div class="panel-body">
                                        <form action="." method="post">
                                            <div class="form-group">
                                                <label for="usr">Username</label>
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span> </span>
                                                    <input type="text" class="form-control" id="usr" placeholder="Username" autofocus>
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <label for="pwd">Password</label>
                                                <div class="input-group">
                                                    <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span> </span>
                                                    <input type="password" class="form-control" id="pwd" placeholder="password">
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button class="btn btn-primary btn-block" type="button" id="signIn">Sign in</button>
                        <button class="btn btn-danger btn-block" type="button" data-dismiss="modal">Cancel</button>
                    </div>
                </div>
            </div>
        </div>

        <script type="text/javascript">
            $(document).ready(function () {
                //登录模态框
                $("#login").click(
                    function () {
                        $('#SignInModal').modal('toggle');
                    }
                );

                //登录按钮
                $("#signIn").click(function () {
                    $.post(
                        'http://localhost:7109/WeekFourClient/login', {
                            username: '12345678901',
                            password: '123456'
                        },
                        function (data) {
                            if (data.st === 1) {
                                alert('sucess');
                                //alert(data.msg);
                                window.href = 'clientHome.html';
                            } else if (data.st === -1) {
                                //alert(data.msg);
                                alert('failed');
                                //window.href = 'clientHome.html';
                            } else {
                                //alert(data.msg);
                                alert('unknown');
                                window.href = 'clientHome.html';
                            }
                        }
                    );
                });
            });
        </script>
</body>

</html>